package com.ovidiojf.siesec.matriculaEscolar;

import java.util.List;

import org.hibernate.Session;

public class MatriculaEscolarDAOHibernate implements MatriculaEscolarDAO {
	
	private Session session;
	
	public Session getSession() {
		return session;
	}
	public void setSession(Session session) {
		this.session = session;
	}
	@Override
	public void salvar(MatriculaEscolar matriculaEscolar) {
		this.session.save(matriculaEscolar);
	}
	@Override
	public void excluir(MatriculaEscolar matriculaEscolar) {
		this.session.delete(matriculaEscolar);
	}
	@Override
	public void alterar(MatriculaEscolar matriculaEscolar) {
		this.session.update(matriculaEscolar);
	}
	@SuppressWarnings("unchecked")
	@Override
	public List<MatriculaEscolar> listar() {
		return this.session.createCriteria(MatriculaEscolar.class).list();
	}

}
